import java.util.Scanner;
import java.awt.List;
import java.util.ArrayList;
//將输入的整数插入到一个已知有序数组的合适位置
public class Hello {
	public static void main(String[] args) {
		int b[] = { 1, 2, 5, 9 };// 7
		int a[] = new int[5];
		// a.length=10;
		int input, i;
		Scanner reader = new Scanner(System.in);
		for (int j = 0; j < b.length; j++)
			a[j] = b[j];
		input = reader.nextInt();
		for (i = a.length - 2; i >= 0; i--) {
			if (a[i] > input)
				a[i + 1] = a[i];
			else
				break;// i=2
		}
		a[i + 1] = input;
		for (int j :a)
			System.out.print("|" + j);

    int ipt = reader.nextInt();
    int c[] = new int[5];
    int c_index = 0;
    for(int j = 0; j < a.length ; j++)
    {
      if(a[j] == ipt)
      {
        continue;
      }
      c[c_index] = a[j];
      c_index = c_index + 1;
    }

		for (int j :c)
			System.out.print("|" + j);
	}
}

